home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-in_the_mag-
/
program_perfection
/
text.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-12-08
|
1KB
|
67 lines
#ifndef TEXT_H
#define TEXT_H
/*
*
* $Id :$
* $Log:$
*
*/
#ifndef DEFS_H
#include "defs.h"
#endif
#ifndef ERRORS_H
#include "errors.h"
#endif
#ifndef LINES_H
#include "lines.h"
#endif
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif
typedef UWORD TEXT_LEN_TYPE;
#define MAX_TEXT_LEN 65534
struct Text
{
struct MinList Contents; /* linked list of lines constitutes this text */
TEXT_LEN_TYPE Length; /* number of lines in said list */
LINE_LEN_TYPE MaxWidth; /* the longest line in the list */
};
typedef struct Text TEXT_TYPE;
typedef struct Text *TEXT_PTR;
struct TextPos
{
TEXT_PTR Line;
LINE_LEN_TYPE Column;
};
typedef struct TextPos TEXT_POS_TYPE;
typedef struct TextPos *TEXT_POS_PTR;
TEXT_PTR Text_New( const STRPTR contents, ERROR_TYPE *err_code );
VOID Text_Dispose( TEXT_PTR text );
LINE_PTR Text_GetTopLine( const TEXT_PTR text );
LINE_PTR Text_GetBottomLine( const TEXT_PTR text );
LINE_PTR Text_GetNextLine( const TEXT_PTR text, const LINE_PTR line );
LINE_PTR Text_GetPrevLine( const TEXT_PTR text, const LINE_PTR line );
LINE_PTR Text_GetNthLine( const TEXT_PTR text, LINE_LEN_TYPE line );
TEXT_LEN_TYPE Text_GetNoOfLines( const TEXT_PTR text );
LINE_LEN_TYPE Text_GetMaxWidth( const TEXT_PTR text );
#endif /* TEXT_H */